Elementary Strong Functional Programming

نویسنده

  • D. A. Turner
چکیده

Functional programming is a good idea, but we haven’t got it quite right yet. What we have been doing up to now is weak (or partial) functional programming. What we should be doing is strong (or total) functional programming in which all computations terminate. We propose an elementary discipline of strong functional programming. A key feature of the discipline is that we introduce a type distinction between data, which is known to be finite, and codata, which is (potentially) infinite. 1 What is Functional Programming? It is widely agreed that functional programming languages make excellent introductory teaching vehicles for the basic concepts of computing. The wide range of topics covered in this symposium is evidence for that. But what is functional programming? Well, it is programming with functions, that much seems clear. But this really is not specific enough. The methods of denotational semantics show us how almost any programming language construction, no matter how opaque and side-effect ridden, can be construed functionally if we are willing to introduce complicated enough spaces for the functions to work on. It is somewhat difficult to pin down with complete precision, but what we conventionally mean by functional programming involves the idea that the functions are transparent in the notation we actually write, rather than having to be teased out by some complex process of interpretation. For example if I write, in Miranda or Haskell (actually neither language has nat as a distinct type, but that’s an oversight) > fac :: nat->nat > fac 0 = 1 > fac (n+1) = (n+1) * fac n then the semantics I intend has that fac really is a function from natural numbers to natural numbers, not something else, such as a function from nat×store

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Linear Logic & Elementary Time

Think of elementary linear logic as an idealized functional programming language with a severe typing mechanism. Definition by recursion is, of course, forbidden, but some sort of iteration still is possible and the purpose of this paper is to show that enough computing power remains so that elementary recursive functions can be implemented. Actually, the whole paper can be considered an exerci...

متن کامل

Ensuring Termination in ESFP

In previous papers we have proposed an elementary discipline of strong functional programming (ESFP), in which all computations terminate. A key feature of the discipline is that we introduce a type distinction between data which is known to be nite, and codata which is (potentially) in nite. To ensure termination, recursion over data must be well-founded, and corecursion (the de nition schema ...

متن کامل

Developing a model to enhance elementary teachers’ ability to foster functional thinking and algebraic reasoning in elementary students

Abstract: This study explores the process of change of grades 3 to 5 elementary teachers, who participated in a professional development program "Algebraic Thinking: Foundation of Elementary Mathematics". Algebraic thinking as a functional thinking was the centerpiece of the program. The “Concern Base Adaptation Model” (CBAM) was used as methodology. The results of the study showed the signific...

متن کامل

Exact Duality in Semidefinite Programming Based on Elementary Reformulations

In semidefinite programming (SDP), unlike in linear programming, Farkas’ lemma may fail to prove infeasibility. Here we obtain an exact, short certificate of infeasibility in SDP by an elementary approach: we reformulate any equality constrained semidefinite system using only elementary row operations, and rotations. When a system is infeasible, the reformulated system is trivially infeasible. ...

متن کامل

Functional Testing in the Focal Environment

This article presents the generation and test case execution under the framework Focal. In the programming language Focal, all properties of the program are written within the source code. These properties are considered, here, as the program specification. We are interested in testing the code against these properties. Testing a property is split in two stages. First, the property is cut out i...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995